# 1 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
;trosyNHv4.ld
;updated 30-march-2011
;see footer for NOTES

;prosol relations=<triple.jlb>

;#include "/opt/topspin/exp/stan/nmr/lists/pp/user/bits.jlb"
# 1 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv" 1
;bits.jlb for datav500 console  (an AVIII console)
# 10 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
define pulse PG1
define pulse PG2
define pulse PG3
define pulse PG4
define pulse PG5
define pulse PG6
define pulse PG7
define pulse PG8
define pulse PG9
define pulse PG10
define pulse PG11
define pulse PG12
define pulse PG13
define pulse PG14
define pulse PG15
define pulse PG16
define pulse PG17
define pulse PG18
define pulse PG20
define pulse PG21
define pulse PG22
define pulse PG23
define pulse PG24
define pulse PG25
define pulse PG26
define pulse PG27
define pulse PG28
define pulse PG29
define pulse PG30
define pulse PG31


;Avance3.incl
;   for AV III
;
;avance-version (07/12/14)
;
;$CLASS=HighRes Incl
;$COMMENT=
# 206 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;$Id: Avance3.incl,v 1.6.2.2 2007/12/14 16:06:46 ber Exp $
;Delay.incl  -  include file for commonly used delays
;
;version 00/02/07
;
;$CLASS=HighRes Incl
;$COMMENT=


;general delays
# 217 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
define delay DELTA
define delay DELTA1
define delay DELTA2
define delay DELTA3
define delay DELTA4
define delay DELTA5
define delay DELTA6
define delay DELTA7
define delay DELTA8
define delay DELTA9
define delay DELTA10
define delay DELTA11
define delay DELTA12


define delay TAU
define delay TAU1
define delay TAU2
define delay TAU3
define delay TAU4
define delay TAU5
# 240 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;delays for centering pulses

define delay CEN_HN1
define delay CEN_HN2
define delay CEN_HN3
define delay CEN_HC1
define delay CEN_HC2
define delay CEN_HC3
define delay CEN_HC4
define delay CEN_HP1
define delay CEN_HP2
define delay CEN_CN1
define delay CEN_CN2
define delay CEN_CN3
define delay CEN_CN4
define delay CEN_CP1
define delay CEN_CP2

# 259 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;loop counters

define loopcounter COUNTER
define loopcounter SCALEF
define loopcounter FACTOR1
define loopcounter FACTOR2
define loopcounter FACTOR3

# 269 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;$Id: Delay.incl,v 1.12 2005/11/10 12:16:58 ber Exp $
;Grad2.incl  -  include file for Gradient Spectroscopy
;   for TCU3
;
;avance-version (07/01/17)
;
;$CLASS=HighRes Incl
;$COMMENT=


# 296 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
define list<gradient> EA=<EA>


# 300 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;$Id: Grad2.incl,v 1.12 2007/01/22 14:22:35 ber Exp $
;De2.incl
;   for AVi
;
;avance-version (08/02/15)
;
;$CLASS=HighRes Incl
;$COMMENT=


define delay rde1
# 313 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
"rde1=de-de1"


# 324 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;for multi receive


# 333 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;$Id: De2.incl,v 1.3.6.3 2008/02/15 15:18:53 ber Exp $
;Daz.incl
;
;Dante-Z
;version  00/02/07
;
;$CLASS=HighRes Incl
;$COMMENT=


define delay DZ_TAU
define delay DZ_TAU2
define delay DZ_TAU3
define delay DZ_DELT			; 1/Bandwidth (cnst8)
# 348 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
define pulse DZ_THET
define pulse DZ_THE2
define pulse DZ_THE3
define pulse DZ_180
define pulse DZ_180a
define pulse DZ_180b
define pulse DZ_180c

define loopcounter DZ_LC1
define loopcounter DZ_LC2
define loopcounter DZ_LC3
define loopcounter DZ_LC4
define loopcounter DZ_LC5

define pulse P_TOTAL
# 365 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
"DZ_THET=10u"
"DZ_THE2=10u*0.5"
"DZ_THE3=10u*0.25"

"DZ_DELT=1s/cnst8"

"DZ_LC1=DZ_DELT/(dw)"
"DZ_LC2=(DZ_DELT/(dw))/3"
"DZ_LC3=(DZ_DELT/(dw))*2/3"
"DZ_LC4=(DZ_DELT/(dw))*2/9"
"DZ_LC5=(DZ_DELT/(dw))*6/9"
# 377 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
"DZ_TAU=dw*0.5"
"DZ_TAU2=dw*0.5*(DZ_LC1/(DZ_LC2*2+DZ_LC3))"
"DZ_TAU3=dw*0.5*(DZ_LC1/(DZ_LC4*4+DZ_LC5))"

"DZ_180=DZ_THET*DZ_LC1*2"
"DZ_180a=DZ_THET*DZ_LC1*2"
"DZ_180b=DZ_THET*DZ_LC2*2+DZ_THET*DZ_LC3*2" 	
				;=DZ_THE2*DZ_LC2*4+DZ_THET*DZ_LC3*2
"DZ_180c=DZ_THET*DZ_LC4+DZ_THET*DZ_LC4*2+DZ_THET*DZ_LC5*2"
				;=DZ_THE3*DZ_LC4*4+DZ_THE2*DZ_LC4*4+DZ_THET*DZ_LC5*2

# 391 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;next four lines commented out by BF 10/07/19
;#define DAZ11(phase1,phase2)                    \n\
;        1001 (DZ_TAU) (DZ_THET phase1):f1     \n\
;             (DZ_TAU) (DZ_THET phase2):f1     \n\
;             lo to 1001 times DZ_LC1            


;#define DAZ363(phase1,phase2)                  \n\
;        1011 (DZ_TAU2) (DZ_THE2 phase1):f1     \n\
;             (DZ_TAU2) (DZ_THE2 phase2):f1     \n\
;             lo to 1011 times DZ_LC2           \n\ 
;        1012 (DZ_TAU2) (DZ_THET phase1):f1     \n\
;             (DZ_TAU2) (DZ_THET phase2):f1     \n\
;             lo to 1012 times DZ_LC3           \n\ 
;        1013 (DZ_TAU2) (DZ_THE2 phase1):f1     \n\
;             (DZ_TAU2) (DZ_THE2 phase2):f1     \n\
;             lo to 1013 times DZ_LC2            
# 410 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;#define DAZ22622(phase1,phase2)                \n\
;        1021 (DZ_TAU3) (DZ_THE3 phase1):f1     \n\
;             (DZ_TAU3) (DZ_THE3 phase2):f1     \n\
;             lo to 1021 times DZ_LC4           \n\ 
;        1022 (DZ_TAU3) (DZ_THE2 phase1):f1     \n\
;             (DZ_TAU3) (DZ_THE2 phase2):f1     \n\
;             lo to 1022 times DZ_LC4           \n\ 
;        1023 (DZ_TAU3) (DZ_THET phase1):f1     \n\
;             (DZ_TAU3) (DZ_THET phase2):f1     \n\
;             lo to 1023 times DZ_LC5           \n\ 
;        1024 (DZ_TAU3) (DZ_THE2 phase1):f1     \n\
;             (DZ_TAU3) (DZ_THE2 phase2):f1     \n\
;             lo to 1024 times DZ_LC4           \n\ 
;        1025 (DZ_TAU3) (DZ_THE3 phase1):f1     \n\
;             (DZ_TAU3) (DZ_THE3 phase2):f1     \n\
;             lo to 1025 times DZ_LC4            
;


# 430 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/bits.vv"
;$Id: Daz.incl,v 1.12 2005/11/10 12:16:58 ber Exp $
# 8 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr" 2


;--- SWITCH -----
# 13 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
;Gradient Pulses
"PG1=1.8m"
"PG2=250u"
"PG3=800u"
"PG4=101.3u"   ;decoding
"PG5=500u"    ;half-encoding
"PG20=500u"

"l5=1"

"d0=3u"                          ;use if set up for (0,0) 15N phase
# 26 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
"DELTA4=p50+p51+4u+d0*2+p21*1.274-p1"  ;phc0=0 phc1=0   aliased peaks same sign
;"d0=in0*0.5-p21*0.637-2u-p50"      ;ph0=90deg ph1=-180deg    aliased peaks opposite sign


# 32 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
                                 ;note well:  will still require a little phase correction in 15N
                                 ;            and will not likely be perfect for all peaks.  This
                                 ;            is due to sequence design.
"p2=p1*2"
"p22=p21*2"

"d11=30m"
"d12=200u"
"d16=190u"      ;Grad Rec. - increasing this may cause some calc. delays to become negative
"d26=2.65m"
"d27=2.65m"
"d6=2.35m"   ;adjust to minimize 15N anti-phase pk (2.1m was optimal for ubiq., but must use correspongdingly shorter p29)
"d28=p27+5u+p1-p21"

"DELTA=d26-PG1-3u-d16"
"DELTA2=d6-PG2-p29-d16"
"DELTA3=d27-PG3-p27-205u"
"DELTA5=300u-PG4-20u-de"       ; make sure there is enough time for Grad Recovery
# 51 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
;*** set o2p = 176 ppm from command line ******************
"cnst21=173.4"  ;176 - 2.6
"cnst22=53.4"   ; 56 - 2.6

"spoff15=bf2*((cnst22-cnst21)/1000000)"
"spoff17=0"

# 1 "mc_line 59 file /opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr dc-measurement inserted automatically"

    dccorr
# 59 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
# 59 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
1       ze
        1m 
2       10u do:f2
        d11
        d12*5
3       d12*5
4       10u
        5m setnmr3^0
        d1 
        1m setnmr3|0 setnmr0|34|32|33 ctrlgrad 0 
        10u pl0:f1
        10u pl3:f3
;        10u pl0:f2
;------- start 90-degree on hn -----------------------
        (p29:sp21 ph11:r):f1
        3u 
        2u pl1:f1
        (p1 ph0):f1
        3u
        PG1:gp1
        DELTA 
        d16
        (center (p2 ph0):f1 (p22 ph0):f3)
        3u
        DELTA 
        PG1:gp1
        d16
        (p1 ph1):f1
        5u
;goto 100        ;optimize sp21 and phcor11       ;WARNING - make sure pl12 is set properly for C' dec
;                                  or comment out C' AQ cpd before using this
;                                  statement.  Ditto for all 'goto 100's'.
        PG20:gp20
        d16 
 ;*****************************************       
  if "l5==1"
      {
      (p21 ph17):f3
;      (p21*2 ph17):f3  ; for calibration
      }
  else
      {
      (p21 ph7):f3
;      (p21*2 ph17):f3  ; for calibration
      }
        d0

        (p50:sp15 ph0):f2
        4u
        (p50:sp17 ph0):f2

# 112 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
        d0
;............ Grad. encoding --------------
        PG5:gp6*EA       ;half-encoding pulse
        200u
   if "l5==1"
     {
      (p22 ph17):f3
      }
  else
      {
      (p22 ph7):f3
      }
        5u
        PG5:gp5*EA        ;half-encoding pulse
        195u
        DELTA4            ;comment out if 90,180 delay selected
        (p1 ph12):f1
        3u 
        2u pl0:f1
        (p29:sp1 ph21:r):f1
;goto 100    ;sp1 and phcor21
        5u 
        PG2:gp2
        DELTA2 
        d16 pl1:f1
        (center (p2 ph0):f1 (p22 ph0):f3)
        5u
        DELTA2
        PG2:gp2
        d16 pl0:f1
        (p29:sp11 ph22:r):f1
        3u 
        2u pl1:f1
        (p1 ph0):f1 (p21 ph14):f3
        5u
;goto 100    ;sp11 and phcor22
        PG3:gp3           
        195u pl18:f1
        DELTA3
    (150u p27 ph10:r 3u 2u pl1 p2 ph0 3u 2u pl18 p27 ph10:r):f1 (d28 p22 ph0):f3 
        3u 
;goto 100      ;pl18 and phcor10
        2u pl1:f1
        PG3:gp3
        DELTA3
        45u
        (p21 ph0):f3
        PG4:gp4               ;decoding gradient
        DELTA5
100     5u
        5u pl12:f2
        10u setnmr0^34^32^33 ctrlgrad 7

        go=2 ph31 cpd2:f2

# 169 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
        10u do:f2
        d11 wr #0 if #0 zd
        d12 igrad EA
        d12 ip12*2
        d12 ip21*2
        d12 ip14*2
        d12 iu5
       lo to 3 times 2
        d12 ip7*2
        d12 ip17*2
        d12 ip31*2
        d12 id0
        d12 ru5
       lo to 4 times l3
1m do:f2
1m do:f3
1m setnmr3^0 
exit    
        
ph0=0
ph1=1          ;original setting = 1     ;check right phase for Boltzmann !!!!!
ph7=1 3 0 2 3 1 2 0 3 1 2 0 1 3 0 2
ph10=2
ph11=3  ;must be 180 deg from ph1
ph12=3
ph14=3
ph17=1 3 2 0 3 1 0 2 3 1 0 2 1 3 2 0
ph21=1
ph22=0
ph31=1 3 2 0 3 1 0 2 3 1 0 2 1 3 2 0


;---- NOTES ----- 
;edited 11-18-2009 to make more consistent with Bruker prosol table
# 204 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
;pulse program archived with 'go' cpd commented out
;tested on AVIII TS2-PL3 consoles
;   (must modify when using 2 13C channels)

;this program does not suppress anti-trosy in 15N dimension

;   (turn on C' cpd during AQ for c13 labeled samples)
; f2=f2=f2(176ppm)   f3=f3 (119ppm)  f1=f1   f4=f5
# 213 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
;1H pulses:
;p1 = 90 deg (10us) hard 1H pulse @ pl1
;p27 = 1.2ms soft 90 deg pulse @ pl18
;p29 = 1.9m @ sp0, sp1, and sp11  (spnam0,1,11 = sinc1.0)

;15N pulse:
;p21 = 90 deg (50us) 15N pulse @pl3

;13C pulse
;p50 = selective 180 deg (23.7*2us @ 600MHz)
; spnam15 and spnam17 = RECT.1000  <= use RECT with 1000 points to make spoff work properly 
;using long shaped pulses make mess up some of the timings, (a delay may become < 0)
;CPDPRG2 = garp  (aq C' dec program)
;pcpd2 = pw for C' aq dec (140u) @ pl12
# 228 "/opt/topspin3.2/exp/stan/nmr/lists/pp/user/trosyNHv4.jr"
;f3  SW = 1/(2*in0)
;echo-antiecho in N15


;RECT pulse pairs do not work well on an AVIII
;gpz1 = 0%  sine.50  ;0% is working best for cryoprobes
;gpz2 = +50%  sine.50
;gpz3 = +70%   sine.100
;gpz4 = +60%  sine.20    Decoding gradient
;gpz5 = -60%  sine.20    half-Encoding gradient
;gpz6 = +60%  sine.20    half-Encoding gradient
;gpz20 = +50% sine.50
